<!DOCTYPE html>
<html>
{include file="public/head"}
<body>
<div >
	<form method="post" action="{:url('admin/pages/add_opt')}" class="layui-form layui-form-pane">
		<div class="layui-form-item">
			<label class="layui-form-label">标题:</label>
			<div class="layui-input-block">
				<input type="text" name="title" class="layui-input">
			</div>
		</div>

		<div class="layui-form-item">
			<label class="layui-form-label">内容:</label>
                        <textarea id="content" style="display: none;" name="content" class="layui-hide">
			</textarea>
		</div>
            <div style="padding-bottom: 20px;" class="nyoj-clear-width">
                <div id='content-ed'></div> 
            </div>
            <div class="layui-form-item" pane>
                <label class="layui-form-label">是否公开:</label>
                <div class="layui-input-block">
                    <input type="radio" name="defunct" value="N" title="是" checked>
                    <input type="radio" name="defunct" value="Y" title="否">
                </div>
            </div>

		<div class="layui-form-item">
			<label class="layui-form-label">权重:</label>
			<div class="layui-input-block">
				<select name="importance" lay-verify="required" id="sell" lay-filter="sel">
					<option value="1">1</option>
					<option value="2">2</option>
					<option value="3">3</option>
					<option value="4">4</option>
					<option value="5">5</option>
					<option value="6">6</option>
					<option value="7">7</option>
					<option value="8">8</option>
					<option value="9">9</option>
					<option value="10">10</option>
				</select>
			</div>
		</div>
                
		<div style="text-align: center;">
			<input type="submit" value="添加" class="layui-btn" >
		</div>
	</form>
</div>
{include file="public/end"}
<script type="text/javascript" src="__STATIC__/WE/wangEditor.min.js"></script>
<script>

layui.use(['form','jquery'],function(){
    var $=layui.jquery;
    
    var E = window.wangEditor;  
        var editor = new E('#content-ed');
        editor.customConfig.uploadImgServer = '/api/uploadimage'; // 上传图片到服务器
        editor.customConfig.uploadImgMaxSize = 3 * 1024 * 1024;
        editor.customConfig.uploadFileName = 'file';
        editor.customConfig.zIndex = 0;
        var $text1 = $('#content');
        editor.customConfig.onchange = function (html) {
            // 监控变化，同步更新到 textarea
            $text1.val(html);
        };
        editor.customConfig.menus = [
        'head',  // 标题
    'bold',  // 粗体
    'fontSize',  // 字号
    'fontName',  // 字体
    'italic',  // 斜体
    'underline',  // 下划线
    'strikeThrough',  // 删除线
    'foreColor',  // 文字颜色
    'backColor',  // 背景颜色
    'link',  // 插入链接
    'list',  // 列表
    'justify',  // 对齐方式
    'quote',  // 引用
    'image',  // 插入图片
    'table',  // 表格
    'video',  // 插入视频
    'code',  // 插入代码
    'undo',  // 撤销
    'redo'  // 重复
    ];
        editor.create();
        $text1.val(editor.txt.html());
});

</script>
</html>